<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$rootpath = "/SiteRoom/";
$hostname_setroma = "localhost:8889";
$database_setroma = "SiteRoom";
$username_setroma = "root";
$password_setroma = "root";
$setroma = mysql_pconnect($hostname_setroma, $username_setroma, $password_setroma) or trigger_error(mysql_error(),E_USER_ERROR);
$db = $setroma; 
mysql_selectdb($database_setroma, $db);

function GetSQLValue($query) {
	
	global $hostname_setroma, $database_setroma, $username_setroma , $password_setroma;
	
	
	$db_temp = mysql_pconnect($hostname_setroma, $username_setroma, $password_setroma) or trigger_error(mysql_error(),E_USER_ERROR);
	mysql_selectdb($database_setroma, $db_temp);
	$results = mysql_query($query, $db_temp) ;
	$row = mysql_fetch_row($results);
	return $row[0];
}

function GetSetting($chiave) {
	
	return GetSQLValue("select valore from settings where parametro='".$chiave."'");
	
}

?>